﻿using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using SingleUserMall.Authorization.Users;
using SingleUserMall.Items;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SingleUserMall.Orders.VO
{
    /// <summary>
    /// 订单
    /// </summary>
    [AutoMapFrom(typeof(Order))]
    public class OrderChargeVO : EntityDto<long>
    {
        internal User inUser { get; set; }
        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderNo { get; set; }
        /// <summary>
        ///  状态（-1：取消，0：未提交，1：待付款，2：已付款，3：已成团，4：已发货，5：已收货，6：已评价）
        /// </summary>
        public OrderStatus? Status { get; set; }
        /// <summary>
        /// 状态名称
        /// </summary>
        public string StatusView => Status?.GetDescription();
        /// <summary>
        /// 合计费用
        /// </summary>
        public decimal? Amount { get; set; }
        /// <summary>
        /// 实际费用
        /// </summary>
        public decimal? ActualAmount { get; set; }
        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime? PayTime { get; set; }
        /// <summary>
        /// 支付人姓名
        /// </summary>
        public string UserName => inUser?.Name;
        /// <summary>
        /// 支付人电话
        /// </summary>
        public string UserPhoneNumber => inUser?.PhoneNumber;
        /// <summary>
        ///  订单类型
        /// </summary>
        public OrderType? OrderType { get; set; }
        /// <summary>
        /// 订单类型名称
        /// </summary>
        public string OrderTypeView => OrderType?.GetDescription();
    }
}
